import request from '@/utils/request'
import request2 from '@/utils/request2'
export function postToken(data) {
  return request({
    url: '/login/api/v1/token',
    method: 'post',
    data
  })
}

// 查询用户信息
export function queryUserInfo(data) {
  return request({
    // url: '/system/api/v1/me',
    url: '/system/test/api/v1/me',
    method: 'get',
    data
  })
}
/**
 * 查询用户权限内信息，过滤人岗客
 * (入参types说明：
 *  brand：品牌，eco_brand：生态品牌
 *  eco_industry：生态产业，industry：产业，cat：产品组
 *  mainchannel：大渠道，subchannel：小渠道
 *  mkt：中心，jyt：经营体
 *  net_center：网格小微
 *  net：网格，shop：门店，cus：管理客户)
 *  逗号分隔，不传表示查全部，例如 ‘ net,mkt’
 * @param params
 * @returns {AxiosPromise}
 */
export function sxCustomerListByUser(params) {
  return request({
    url: '/rqk/internal/api/v1/user/privilege/effective/specifyDim',
    method: 'get',
    params
  })
}
//物料申请待办列表
export function taskNumber(params) {
  return request({
    url: '/hnm/shop/api/v1/material/query/taskNumber',
    method: 'get',
    params
  })
}
//物料申请列表
export function materialApplyList(params) {
  return request({
    url: '/hnm/shop/api/v1/material/query/materialApplyList',
    method: 'get',
    params
  })
}
//查询门店信息
export function querySelectShop(params) {
  return request({
    url: '/hnm/shop/api/v1/material/query/userShopList',
    method: 'get',
    params
  })
}
//根据门店查小微渠道
export function shopDetails(params) {
  return request({
    url: '/hnm/shop/api/v1/material/query/shopDetails',
    method: 'get',
    params
  })
}
//查产业
export function userMktAndIndustry(params) {
  return request({
    url: '/hnm/shop/api/v1/material/query/userMktAndIndustry',
    method: 'get',
    params
  })
}
//根据小微、产业查主题
export function materialApplyThemeInfo(params) {
  return request({
    url: '/hnm/shop/api/v1/material/query/materialApplyThemeInfo',
    method: 'get',
    params
  })
}
//根据主题查物料
export function materialApplyMaterialInfo(params) {
  return request({
    url: '/hnm/shop/api/v1/material/query/materialApplyMaterialInfo',
    method: 'get',
    params
  })
}
//物料申请保存
export function materialsApplyInfo(data) {
  return request({
    url: '/hnm/shop/api/v1/material/save/materialsApplyInfo',
    method: 'post',
    data
  })
}
//物料申请详情
export function materialsApplyDetails(params) {
  return request({
    url: '/hnm/shop/api/v1/material/query/materialsApplyDetails',
    method: 'get',
    params
  })
}
/**
 * 查询中心编码
 * @param data
 * @returns {AxiosPromise}
 */
// userCode=00610022
export function mtkcode(params) {
  return request({
    url: '/rqk/internal/api/v1/user/privilege/effective/mkt',
    method: 'get',
    params
  })
}
/**
 * 查询颗粒度
 * @param data
 * @returns {AxiosPromise}
 */
export function grainClass(data) {
  return request({
    url: '/hnm/hx/api/build/houses/grainClass',
    method: 'post',
    data
  })
}

/**
 * 查询品牌
 * @param params
 * @returns {AxiosPromise}
 */
export function brandClass(params) {
  return request({
    url: '/hnm/hx/api/build/houses/brandClass',
    method: 'get',
    params
  })
}

/**
 * 查询开户行
 * @param params
 * @returns {AxiosPromise}
 */
export function buildHousesApplyBank(params) {
  return request({
    url: '/hnm/hx/api/build/houses/buildHousesApplyBank',
    method: 'post',
    params
  })
}

/**
 * 查询理货商
 * @param params
 * @returns {AxiosPromise}
 */
export function businessClass(params) {
  return request({
    url: '/hnm/hx/api/build/houses/businessClass',
    method: 'post',
    params
  })
}

/**
 * 查询产品信息
 * @param params
 * @returns {AxiosPromise}
 */
export function productClass(params) {
  return request({
    url: '/hnm/hx/api/build/houses/productClass',
    method: 'get',
    params
  })
}

/**
 * 查询经营体
 * @param params
 * @returns {AxiosPromise}
 */
export function queryJyt(params) {
  return request({
    url: '/rqk/internal/api/v1/user/privilege/effective/tree/mkt/netcenter',
    method: 'get',
    params
  })
}
//获取上一次地址
export function lastTimeReceiveAddress(params) {
  return request({
    url: '/hnm/shop/api/v1/material/query/lastTimeReceiveAddress',
    method: 'get',
    params
  })
}
export function qianShouMaterials(data) {
  return request({
    url: '/hnm/shop/api/v1/material/qianShouMaterials',
    method: 'post',
    data
  })
}